<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
  <link rel="stylesheet" type="text/css" href="../../layui/css/layui.css" />
</head>

<body>
  <div id="app">
    <p> 当前的index指针的值为: {{ index }}</p>
    <button @click="update">使用method声明方法</button>
    <button @click="index++">直接书写函数逻辑</button>
  </div>
  <script type="text/javascript" src="../plugin/jquery.min.js"></script>
  <script type="text/javascript" src="../plugin/lodash.min.js"></script>
  <script type="text/javascript" src="../../layui/layui.js"></script>
  <script>
    layui.extend({
      binder: "../../layui_exts/binder/binder",
    }).use(['binder'], function () {
      var app = new layui.binder({
        el: "#app",
        data: {
          index: 1
        },
        methods: {
          update() {
            this.index++;
          }
        },
      });
    });
  </script>
</body>

</html>